<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>设备管理</title>
  <link rel="stylesheet" type="text/css" href="js/css/normalize.css">
  <link rel="stylesheet" type="text/css" href="js/css/main.css">
  <link rel="stylesheet" type="text/css" href="js/css/layui.css">
  <link rel="stylesheet" type="text/css" href="js/css/modules/laydate/default/laydate.css">
  <link rel="stylesheet" type="text/css" href="js/css/modules/layer/default/layer.css">
  <link rel="stylesheet" type="text/css" href="js/css/modules/code.css">
  <script type="text/javascript" src="js/devicemanage.js"></script>
  <script type="text/javascript" src="js/jquery.js"></script>
  <script type="text/javascript" src="js/layui.all.js"></script>
</head>
<body>

<div>
  <h1>校园智能安防系统</h1>
</div>

<div>
  <h2>个人信息</h2>
  <div>
    <ul>
      <li>用户名 <span id="username"></span></li>
      <li>ID <span id="userId"></span></li>
      <li>权限 <span id="userAuth"></span></li>
      <li>描述 <span id="userDes"></span></li>
    </ul>
  </div>
  <button onclick="logout()"></button>
  <div class="layui-form">
    <div class="layui-form-item">
      <label class="layui-form-label" for="changeDes">修改描述</label>
      <div class="layui-input-block">
        <input id="changeDes" name="d" type="text" placeholder="请输入" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" onclick="changeDescription()">修改</button>
      </div>
    </div>
  </div>

  <div class="layui-form">
    <div class="layui-form-item">
      <label class="layui-form-label" for="origin">旧密码</label>
      <div class="layui-input-block">
        <input id="origin" type="password" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label" for="newP">新密码</label>
      <div class="layui-input-block">
        <input id="newP" type="password" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" onclick="changePassword()">修改密码</button>
      </div>
    </div>
    <div id="message"></div>
  </div>
</div>

<div id="user-manage">
  <h2>用户管理</h2>
  可以直接在表格里修改用户信息
  <table id="users" lay-filter="users" lay-data="{id:'users'}"></table>
</div>

<div>
  <h2>设备管理</h2>
  <div>
    <p>地点列表 双击列表元素，即可查看地点具体信息</p>
    <table id="locations" lay-filter="test" lay-data="{id:'locations'}"></table>

    <div class="layui-form" id="location-form">
      <div class="layui-form-item">
        <label class="layui-form-label" for="name">地点名称</label>
        <div class="layui-input-block">
          <input id="name" type="text" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" for="des">位置</label>
        <div class="layui-input-block">
          <input id="des" type="text" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item" id="add-location">
        <div class="layui-input-block">
          <button class="layui-btn" onclick="addLocation()">添加地点</button>
        </div>
      </div>
    </div>
    <div id="tableMessage"></div>
  </div>
  <div id="location-panel">
    <h2>地点 <span id="current-location"> </span></h2>
    <div>
      <p>设备列表</p>
      <table id="devices" lay-filter="devices"></table>
      <div id="tableMessage2"></div>
    </div>
    <div>
      <p>该地点事件记录 输入时间段查询，留空则查询最近100条</p>
      <div class="layui-form" id="record-form">
        <div class="layui-form-item">
          <label class="layui-form-label" for="start">从</label>
          <div class="layui-input-block">
            <input id="start" type="text" class="layui-input">
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label" for="end">至</label>
          <div class="layui-input-block">
            <input id="end" type="text" class="layui-input">
          </div>
        </div>
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" onclick="getRecords()">查询</button>
          </div>
        </div>
        <div id="tableMessage3"></div>
      </div>
      <table id="records" lay-filter="records"></table>
    </div>
  </div>
</div>
</body>
</html>
